/*
 * Copyright (c) 2016.
 * Modified by Neurophobic Animal on 07/06/2016.
 */

package cm.aptoide.pt.dataprovider.model.v7;

import java.util.List;

/**
 * List of various malware reasons http://ws2.aptoide .com/api/7/getApp/apk_md5sum/7de07d96488277d8d76eafa2ef66f5a8
 * <p>
 * <p>
 * RANK2: http://ws2.aptoide.com/api/7/getApp/apk_md5sum/7de07d96488277d8d76eafa2ef66f5a8
 * http://ws2.aptoide.com/api/7/getApp/apk_md5sum/06c9eb56b787b6d3b606d68473a38f47
 * <p>
 * RANK3: http://ws2.aptoide.com/api/7/getApp/apk_md5sum/18f0d5bdb9df1e0e27604890113c3331
 * http://ws2.aptoide.com/api/7/getApp/apk_md5sum/74cbfde9dc6da43d3d14f4df9cdb9f2f
 * <p>
 * Rank can be: TRUSTED, WARNING, UNKNOWN, CRITICAL
 */
public class Malware {

  public static final String PASSED = "passed";
  public static final String WARN = "warn";
  public static final String GOOGLE_PLAY = "Google Play";

  private Rank rank;
  private Reason reason;
  private String added;
  private String modified;

  public Malware() {
  }

  public Rank getRank() {
    return this.rank;
  }

  public void setRank(Rank rank) {
    this.rank = rank;
  }

  public Reason getReason() {
    return this.reason;
  }

  public void setReason(Reason reason) {
    this.reason = reason;
  }

  public String getAdded() {
    return this.added;
  }

  public void setAdded(String added) {
    this.added = added;
  }

  public String getModified() {
    return this.modified;
  }

  public void setModified(String modified) {
    this.modified = modified;
  }

  public int hashCode() {
    final int PRIME = 59;
    int result = 1;
    final Object $rank = this.getRank();
    result = result * PRIME + ($rank == null ? 43 : $rank.hashCode());
    final Object $reason = this.getReason();
    result = result * PRIME + ($reason == null ? 43 : $reason.hashCode());
    final Object $added = this.getAdded();
    result = result * PRIME + ($added == null ? 43 : $added.hashCode());
    final Object $modified = this.getModified();
    result = result * PRIME + ($modified == null ? 43 : $modified.hashCode());
    return result;
  }

  protected boolean canEqual(Object other) {
    return other instanceof Malware;
  }

  public enum Rank {
    TRUSTED, WARNING, UNKNOWN, CRITICAL
  }

  public static class Reason {

    private Reason.SignatureValidated signatureValidated;
    private Reason.ThirdPartyValidated thirdpartyValidated;
    private Reason.Manual manual;
    private Reason.Scanned scanned;

    public Reason() {
    }

    public SignatureValidated getSignatureValidated() {
      return this.signatureValidated;
    }

    public void setSignatureValidated(SignatureValidated signatureValidated) {
      this.signatureValidated = signatureValidated;
    }

    public ThirdPartyValidated getThirdpartyValidated() {
      return this.thirdpartyValidated;
    }

    public void setThirdpartyValidated(ThirdPartyValidated thirdpartyValidated) {
      this.thirdpartyValidated = thirdpartyValidated;
    }

    public Manual getManual() {
      return this.manual;
    }

    public void setManual(Manual manual) {
      this.manual = manual;
    }

    public Scanned getScanned() {
      return this.scanned;
    }

    public void setScanned(Scanned scanned) {
      this.scanned = scanned;
    }

    protected boolean canEqual(Object other) {
      return other instanceof Reason;
    }

    public enum Status {
      passed, failed, blacklisted, warn
    }

    public static class SignatureValidated {

      private String date;
      private Reason.Status status;
      private String signatureFrom;

      public SignatureValidated() {
      }

      public String getDate() {
        return this.date;
      }

      public void setDate(String date) {
        this.date = date;
      }

      public Status getStatus() {
        return this.status;
      }

      public void setStatus(Status status) {
        this.status = status;
      }

      public String getSignatureFrom() {
        return this.signatureFrom;
      }

      public void setSignatureFrom(String signatureFrom) {
        this.signatureFrom = signatureFrom;
      }

      protected boolean canEqual(Object other) {
        return other instanceof SignatureValidated;
      }

      public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof SignatureValidated)) return false;
        final SignatureValidated other = (SignatureValidated) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$date = this.getDate();
        final Object other$date = other.getDate();
        if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false;
        final Object this$status = this.getStatus();
        final Object other$status = other.getStatus();
        if (this$status == null ? other$status != null : !this$status.equals(other$status)) {
          return false;
        }
        final Object this$signatureFrom = this.getSignatureFrom();
        final Object other$signatureFrom = other.getSignatureFrom();
        if (this$signatureFrom == null ? other$signatureFrom != null
            : !this$signatureFrom.equals(other$signatureFrom)) {
          return false;
        }
        return true;
      }

      public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $date = this.getDate();
        result = result * PRIME + ($date == null ? 43 : $date.hashCode());
        final Object $status = this.getStatus();
        result = result * PRIME + ($status == null ? 43 : $status.hashCode());
        final Object $signatureFrom = this.getSignatureFrom();
        result = result * PRIME + ($signatureFrom == null ? 43 : $signatureFrom.hashCode());
        return result;
      }

      public String toString() {
        return "Malware.Reason.SignatureValidated(date="
            + this.getDate()
            + ", status="
            + this.getStatus()
            + ", signatureFrom="
            + this.getSignatureFrom()
            + ")";
      }
    }

    public static class ThirdPartyValidated {

      private String date;
      private String store;

      public ThirdPartyValidated() {
      }

      public String getDate() {
        return this.date;
      }

      public void setDate(String date) {
        this.date = date;
      }

      public String getStore() {
        return this.store;
      }

      public void setStore(String store) {
        this.store = store;
      }

      protected boolean canEqual(Object other) {
        return other instanceof ThirdPartyValidated;
      }

      public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof ThirdPartyValidated)) return false;
        final ThirdPartyValidated other = (ThirdPartyValidated) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$date = this.getDate();
        final Object other$date = other.getDate();
        if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false;
        final Object this$store = this.getStore();
        final Object other$store = other.getStore();
        if (this$store == null ? other$store != null : !this$store.equals(other$store)) {
          return false;
        }
        return true;
      }

      public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $date = this.getDate();
        result = result * PRIME + ($date == null ? 43 : $date.hashCode());
        final Object $store = this.getStore();
        result = result * PRIME + ($store == null ? 43 : $store.hashCode());
        return result;
      }

      public String toString() {
        return "Malware.Reason.ThirdPartyValidated(date="
            + this.getDate()
            + ", store="
            + this.getStore()
            + ")";
      }
    }

    public static class Manual {

      private String date;
      private Reason.Status status;
      private List<String> av;

      public Manual() {
      }

      public String getDate() {
        return this.date;
      }

      public void setDate(String date) {
        this.date = date;
      }

      public Status getStatus() {
        return this.status;
      }

      public void setStatus(Status status) {
        this.status = status;
      }

      public List<String> getAv() {
        return this.av;
      }

      public void setAv(List<String> av) {
        this.av = av;
      }

      protected boolean canEqual(Object other) {
        return other instanceof Manual;
      }

      public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof Manual)) return false;
        final Manual other = (Manual) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$date = this.getDate();
        final Object other$date = other.getDate();
        if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false;
        final Object this$status = this.getStatus();
        final Object other$status = other.getStatus();
        if (this$status == null ? other$status != null : !this$status.equals(other$status)) {
          return false;
        }
        final Object this$av = this.getAv();
        final Object other$av = other.getAv();
        if (this$av == null ? other$av != null : !this$av.equals(other$av)) return false;
        return true;
      }

      public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $date = this.getDate();
        result = result * PRIME + ($date == null ? 43 : $date.hashCode());
        final Object $status = this.getStatus();
        result = result * PRIME + ($status == null ? 43 : $status.hashCode());
        final Object $av = this.getAv();
        result = result * PRIME + ($av == null ? 43 : $av.hashCode());
        return result;
      }

      public String toString() {
        return "Malware.Reason.Manual(date="
            + this.getDate()
            + ", status="
            + this.getStatus()
            + ", av="
            + this.getAv()
            + ")";
      }
    }

    public static class Scanned {

      private Reason.Status status;
      private String date;
      private List<Reason.Scanned.AvInfo> avInfo;

      public Scanned() {
      }

      public Status getStatus() {
        return this.status;
      }

      public void setStatus(Status status) {
        this.status = status;
      }

      public String getDate() {
        return this.date;
      }

      public void setDate(String date) {
        this.date = date;
      }

      public List<AvInfo> getAvInfo() {
        return this.avInfo;
      }

      public void setAvInfo(List<AvInfo> avInfo) {
        this.avInfo = avInfo;
      }

      protected boolean canEqual(Object other) {
        return other instanceof Scanned;
      }

      public static class AvInfo {

        private List<Reason.Scanned.AvInfo.Infection> infections;
        private String name;

        public AvInfo() {
        }

        public List<Infection> getInfections() {
          return this.infections;
        }

        public void setInfections(List<Infection> infections) {
          this.infections = infections;
        }

        public String getName() {
          return this.name;
        }

        public void setName(String name) {
          this.name = name;
        }

        protected boolean canEqual(Object other) {
          return other instanceof AvInfo;
        }

        public static class Infection {

          private String name;
          private String description;

          public Infection() {
          }

          public String getName() {
            return this.name;
          }

          public void setName(String name) {
            this.name = name;
          }

          public String getDescription() {
            return this.description;
          }

          public void setDescription(String description) {
            this.description = description;
          }

          protected boolean canEqual(Object other) {
            return other instanceof Infection;
          }

          public boolean equals(Object o) {
            if (o == this) return true;
            if (!(o instanceof Infection)) return false;
            final Infection other = (Infection) o;
            if (!other.canEqual((Object) this)) return false;
            final Object this$name = this.getName();
            final Object other$name = other.getName();
            if (this$name == null ? other$name != null : !this$name.equals(other$name)) {
              return false;
            }
            final Object this$description = this.getDescription();
            final Object other$description = other.getDescription();
            if (this$description == null ? other$description != null
                : !this$description.equals(other$description)) {
              return false;
            }
            return true;
          }

          public int hashCode() {
            final int PRIME = 59;
            int result = 1;
            final Object $name = this.getName();
            result = result * PRIME + ($name == null ? 43 : $name.hashCode());
            final Object $description = this.getDescription();
            result = result * PRIME + ($description == null ? 43 : $description.hashCode());
            return result;
          }

          public String toString() {
            return "Malware.Reason.Scanned.AvInfo.Infection(name="
                + this.getName()
                + ", description="
                + this.getDescription()
                + ")";
          }
        }

        public boolean equals(Object o) {
          if (o == this) return true;
          if (!(o instanceof AvInfo)) return false;
          final AvInfo other = (AvInfo) o;
          if (!other.canEqual((Object) this)) return false;
          final Object this$infections = this.getInfections();
          final Object other$infections = other.getInfections();
          if (this$infections == null ? other$infections != null
              : !this$infections.equals(other$infections)) {
            return false;
          }
          final Object this$name = this.getName();
          final Object other$name = other.getName();
          if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
          return true;
        }

        public int hashCode() {
          final int PRIME = 59;
          int result = 1;
          final Object $infections = this.getInfections();
          result = result * PRIME + ($infections == null ? 43 : $infections.hashCode());
          final Object $name = this.getName();
          result = result * PRIME + ($name == null ? 43 : $name.hashCode());
          return result;
        }

        public String toString() {
          return "Malware.Reason.Scanned.AvInfo(infections="
              + this.getInfections()
              + ", name="
              + this.getName()
              + ")";
        }
      }

      public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof Scanned)) return false;
        final Scanned other = (Scanned) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$status = this.getStatus();
        final Object other$status = other.getStatus();
        if (this$status == null ? other$status != null : !this$status.equals(other$status)) {
          return false;
        }
        final Object this$date = this.getDate();
        final Object other$date = other.getDate();
        if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false;
        final Object this$avInfo = this.getAvInfo();
        final Object other$avInfo = other.getAvInfo();
        if (this$avInfo == null ? other$avInfo != null : !this$avInfo.equals(other$avInfo)) {
          return false;
        }
        return true;
      }

      public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $status = this.getStatus();
        result = result * PRIME + ($status == null ? 43 : $status.hashCode());
        final Object $date = this.getDate();
        result = result * PRIME + ($date == null ? 43 : $date.hashCode());
        final Object $avInfo = this.getAvInfo();
        result = result * PRIME + ($avInfo == null ? 43 : $avInfo.hashCode());
        return result;
      }

      public String toString() {
        return "Malware.Reason.Scanned(status="
            + this.getStatus()
            + ", date="
            + this.getDate()
            + ", avInfo="
            + this.getAvInfo()
            + ")";
      }
    }

    public boolean equals(Object o) {
      if (o == this) return true;
      if (!(o instanceof Reason)) return false;
      final Reason other = (Reason) o;
      if (!other.canEqual((Object) this)) return false;
      final Object this$signatureValidated = this.getSignatureValidated();
      final Object other$signatureValidated = other.getSignatureValidated();
      if (this$signatureValidated == null ? other$signatureValidated != null
          : !this$signatureValidated.equals(other$signatureValidated)) {
        return false;
      }
      final Object this$thirdpartyValidated = this.getThirdpartyValidated();
      final Object other$thirdpartyValidated = other.getThirdpartyValidated();
      if (this$thirdpartyValidated == null ? other$thirdpartyValidated != null
          : !this$thirdpartyValidated.equals(other$thirdpartyValidated)) {
        return false;
      }
      final Object this$manual = this.getManual();
      final Object other$manual = other.getManual();
      if (this$manual == null ? other$manual != null : !this$manual.equals(other$manual)) {
        return false;
      }
      final Object this$scanned = this.getScanned();
      final Object other$scanned = other.getScanned();
      if (this$scanned == null ? other$scanned != null : !this$scanned.equals(other$scanned)) {
        return false;
      }
      return true;
    }

    public int hashCode() {
      final int PRIME = 59;
      int result = 1;
      final Object $signatureValidated = this.getSignatureValidated();
      result = result * PRIME + ($signatureValidated == null ? 43 : $signatureValidated.hashCode());
      final Object $thirdpartyValidated = this.getThirdpartyValidated();
      result =
          result * PRIME + ($thirdpartyValidated == null ? 43 : $thirdpartyValidated.hashCode());
      final Object $manual = this.getManual();
      result = result * PRIME + ($manual == null ? 43 : $manual.hashCode());
      final Object $scanned = this.getScanned();
      result = result * PRIME + ($scanned == null ? 43 : $scanned.hashCode());
      return result;
    }

    public String toString() {
      return "Malware.Reason(signatureValidated="
          + this.getSignatureValidated()
          + ", thirdpartyValidated="
          + this.getThirdpartyValidated()
          + ", manual="
          + this.getManual()
          + ", scanned="
          + this.getScanned()
          + ")";
    }
  }

  public boolean equals(Object o) {
    if (o == this) return true;
    if (!(o instanceof Malware)) return false;
    final Malware other = (Malware) o;
    if (!other.canEqual((Object) this)) return false;
    final Object this$rank = this.getRank();
    final Object other$rank = other.getRank();
    if (this$rank == null ? other$rank != null : !this$rank.equals(other$rank)) return false;
    final Object this$reason = this.getReason();
    final Object other$reason = other.getReason();
    if (this$reason == null ? other$reason != null : !this$reason.equals(other$reason)) {
      return false;
    }
    final Object this$added = this.getAdded();
    final Object other$added = other.getAdded();
    if (this$added == null ? other$added != null : !this$added.equals(other$added)) return false;
    final Object this$modified = this.getModified();
    final Object other$modified = other.getModified();
    if (this$modified == null ? other$modified != null : !this$modified.equals(other$modified)) {
      return false;
    }
    return true;
  }

  public String toString() {
    return "Malware(rank="
        + this.getRank()
        + ", reason="
        + this.getReason()
        + ", added="
        + this.getAdded()
        + ", modified="
        + this.getModified()
        + ")";
  }
}
